
# -*- makefile -*-
# Makefile for Windows with Symbian-OS

OBJS = class.o compiler.o database.o xml.o hashtab.o file.o symtab.o btree.o \
	cursor.o query.o pagepool.o blob.o container.o rtree.o exception.o localcli.o

INCS = gigabase.h stdtp.h class.h database.h cursor.h selection.h reference.h wwwapi.h array.h \
	file.h hashtab.h btree.h sync.h query.h datetime.h pagepool.h blob.h container.h rectangle.h timeseries.h config.h confdefs.h exception.h

SYMBIAN_SDK_HOME=C:/Symbian/9.2/S60_3rd_fp1/Epoc32
STDLIBS =

VERSION=2
GB_LIB = libgigabase.a
GB_LIBS=$(GB_LIB)

CC = arm-none-symbianelf-g++.exe -I$(SYMBIAN_SDK_HOME)/include -I$(SYMBIAN_SDK_HOME)/include/libc
# !!! DEFS macro is deprecated - edit config.h header file instead
DEFS = -D__GCCE__ -D_UNICODE -D__EABI__=1 -D__EPOC32__ -D__GCC32__ -D__GCCXML__ -D__SYMBIAN32__

#CFLAGS = -c -Wall -O5 -g $(DEFS)
CFLAGS = -c -Wall -O0 -g $(DEFS)
#CFLAGS = -c -Wall -O0 -DGIGABASE_DEBUG=DEBUG_TRACE -g $(DEFS)


LD = $(CC)
LDFLAGS = -g $(TFLAGS)

AR = arm-none-symbianelf-ar.exe
ARFLAGS = -cru

RANLIB = arm-none-symbianelf-ranlib.exe


all: $(GB_LIB) 

class.o: class.cpp compiler.h compiler.d symtab.h $(INCS)
	$(CC) $(CFLAGS) class.cpp

compiler.o: compiler.cpp compiler.h compiler.d symtab.h $(INCS)
	$(CC) $(CFLAGS) compiler.cpp

query.o: query.cpp compiler.h compiler.d symtab.h $(INCS)
	$(CC) $(CFLAGS) query.cpp

database.o: database.cpp compiler.h compiler.d symtab.h $(INCS)
	$(CC) $(CFLAGS) database.cpp

xml.o: xml.cpp compiler.h compiler.d symtab.h $(INCS)
	$(CC) $(CFLAGS) xml.cpp

localcli.o: localcli.cpp compiler.h compiler.d symtab.h localcli.h $(INCS)
	$(CC) $(CFLAGS) localcli.cpp

cursor.o: cursor.cpp compiler.h compiler.d $(INCS)
	$(CC) $(CFLAGS) cursor.cpp

hashtab.o: hashtab.cpp $(INCS)
	$(CC) $(CFLAGS) hashtab.cpp

pagepool.o: pagepool.cpp $(INCS)
	$(CC) $(CFLAGS) pagepool.cpp

file.o: file.cpp $(INCS)
	$(CC) $(CFLAGS) file.cpp

symtab.o: symtab.cpp symtab.h $(INCS)
	$(CC) $(CFLAGS) symtab.cpp

btree.o: btree.cpp $(INCS)
	$(CC) $(CFLAGS) btree.cpp

rtree.o: rtree.cpp $(INCS)
	$(CC) $(CFLAGS) rtree.cpp

exception.o: exception.cpp $(INCS)
	$(CC) $(CFLAGS) exception.cpp

blob.o: blob.cpp $(INCS)
	$(CC) $(CFLAGS) blob.cpp

container.o: container.cpp $(INCS)
	$(CC) $(CFLAGS) container.cpp

libgigabase.a: $(OBJS)
	-del libgigabase.a
	$(AR) $(ARFLAGS) libgigabase.a $(OBJS)
	$(RANLIB) libgigabase.a

cleanobj:
	-del *.o

clean: cleanobj
	-del *.a

